<h1 id="dhcpd">dhcpd</h1>
<p>运行DHCP服务器。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">dhcpd [选项] [网络接口]</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-p &lt;端口&gt; 指定dhcpd监听的端口
-f 作为前台进程运行dhcpd
-d 启用调试模式
-q 在启动时不显示版权信息
-t 简单地测试配置文件的语法是否正确的，但不会尝试执行任何网络操作
-T 可以用来测试租约数据库文件
-4 运行DHCP服务器
-6 运行DHCPv6服务器
-s &lt;服务器&gt; 指定发送回复的服务器
-cf &lt;配置文件&gt; 指定配置文件
-lf &lt;租约文件&gt; 指定租约文件
-pf &lt;PID文件&gt; 指定PID文件
-tf &lt;跟踪输出文件&gt; 指定文件记录DHCP服务器的整个启动状态</code></pre>
<h3 id="例子">例子</h3>
<p>对DHCP服务器进行排错。</p>
<div class="sourceCode" id="cb3"><pre><code class="language-bash"><a class="sourceLine" id="cb3-1" data-line-number="1">[<span class="ex">root@localhost</span> ~]# dhcpd</a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="ex">InternetSystems</span> Consortium DHCP Server 4.1.1-P1</a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="ex">Copyright2004-2010</span> Internet Systems Consortium.</a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="ex">All</span> rightsreserved.</a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="ex">For</span> info,please visit https://www.isc.org/software/dhcp/</a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="ex">Not</span> searchingLDAP since ldap-server, ldap-port and ldap-base-dn were not specified in theconfig file</a>
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="ex">Wrote</span> 0deleted host decls to leases file.</a>
<a class="sourceLine" id="cb3-8" data-line-number="8"><span class="ex">Wrote</span> 0 newdynamic host decls to leases file.</a>
<a class="sourceLine" id="cb3-9" data-line-number="9"><span class="ex">Wrote</span> 1leases to leases file.</a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="ex">Listening</span> onLPF/eth0/00:0c:29:fc:2f:e5/192.168.0.0/24</a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="ex">Sendingon</span>  LPF/eth0/00:0c:29:fc:2f:e5/192.168.0.0/24</a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="ex">Sendingon</span>   Socket/fallback/fallback-net</a>
<a class="sourceLine" id="cb3-13" data-line-number="13">[<span class="ex">root@rhel</span>~]# There<span class="st">&#39;s already a DHCP server running.</span></a>
<a class="sourceLine" id="cb3-14" data-line-number="14"><span class="st"> </span></a>
<a class="sourceLine" id="cb3-15" data-line-number="15"><span class="st">This versionof ISC DHCP is based on the release available</span></a>
<a class="sourceLine" id="cb3-16" data-line-number="16"><span class="st">onftp.isc.org.  Features have been addedand other changes</span></a>
<a class="sourceLine" id="cb3-17" data-line-number="17"><span class="st">have beenmade to the base software release in order to make</span></a>
<a class="sourceLine" id="cb3-18" data-line-number="18"><span class="st">it workbetter with this distribution.</span></a>
<a class="sourceLine" id="cb3-19" data-line-number="19"><span class="st"> </span></a>
<a class="sourceLine" id="cb3-20" data-line-number="20"><span class="st">exiting.</span></a></code></pre></div>
<!-- Linux命令行搜索引擎：https://jaywcjlove.github.io/linux-command/ -->
